package com.eshop.modules.monitor.config;

import org.springframework.boot.ApplicationArguments;
import com.eshop.modules.monitor.service.VisitsService;
import org.springframework.boot.ApplicationRunner;

public class VisitsInitialization implements ApplicationRunner
{
    private final VisitsService visitsService;
    
    public VisitsInitialization(final VisitsService visitsService) {
        this.visitsService = visitsService;
    }
    
    public void run(final ApplicationArguments args) {
        System.out.println("--------------- 初始化站点统计，如果存在今日统计则跳过 ---------------");
        this.visitsService.save();
        System.out.println("--------------- 初始化站点统计完成 ---------------");
    }
}
